<?php $this->load->view('public/member_pubnav');?>
<?php $user = $this->session->userdata('member_name');?>
<?php $user_id = $this->session->userdata('member_id');?>
<?php if(empty($result)){?>
<div class="main_special">
    <div class="null_special">
        <div id="pic"><img src="/image/publick/user-speical.jpg"></div>
        <div id="con_special">
            <h5>你还没有出专辑哦，</h5>
            <?php if(!empty($user)){?>
            <h5 id="me"><a href="javascript:void(0)" onclick="openlogin()">点我</a></h5>
            <?php }else{?>
            <h5 id="me"><a href="javascript:alert('您还未登录，请先登录后再来创建吧~');">点我</a></h5>
            <?php }?>
            <h5>就有了</h5></div>
    </div>
    <p style="color: red;text-align: center"><?php if(!empty($error)) echo urldecode($error);?></p>
</div>
<?php }else{?>
<div class="main_special1">
  <div id="Released_album">
      <div class="Released_album_1"><b>
      <?php if(!empty($user_id)){?>
      <a href="javascript:void(0)" onclick="openlogin()">+ 发表专辑</a>
      <?php }else{?>
      <a href="javascript:void(0)" onclick="javascript:alert('请先登录！')">+ 发表专辑</a>
      <?php }?>
      </b></div>
 </div>
	 <?php foreach($result as $k => $v):?>
	 <?php 
		 $baby = $this->like_baby->get_list(array('liker_id'=>$user_id,'column_id'=>$v['id']));
		 $baby_num = count($baby);
	 ?>
	 <div id="Released_album1">
	          <div class="top_album">
			          <div class="ltop_album"><a href="<?php echo front_url('column/detail').'/'.$v['id'];?>"><?php echo $v['title']?></a></div>
					  <div class="rtop_album" style="padding-left:20px;"><?php echo $baby_num;?>个宝贝</div>
			  </div>
			  <div class="middow_album">
			  <?php 
			  	if(!empty($baby)){
			  ?>
		  		  <?php foreach($baby as $bk => $bv){
                                $one_baby = $this->baby->get_one_list($bv['baby_id']);
                          ?>
				  <a href="<?php echo front_url('index/baby_detail').'/'.$one_baby['id'];?>" target="_blank"><img src="<?php echo base_url().'upload/baby/'.$one_baby['small_img'];?>" class="middow_album_small"/></a>
			  <?php }}?>							  
			  </div>

			  <div class="top_album" style="clear:both">
		          <a title="编辑 专辑" href="<?php echo front_url('column/column_edit').'/'.$v['id'];?>">
					<span class="edit-icon"></span>
					</a>
				  <a class="delete-row" title="删除 专辑" onclick="return confirm('确定删除？');" href="<?php echo front_url('column/column_delete').'/'.$v['id'];?>">
				  	<span class="delete-icon"></span>
				 </a>
			  </div>
	 </div>
	 <?php endforeach;?>
 </div>
 <?php }?>
<div id="bg"></div>
<div class="clr1"></div>
<div id="form5" style="height:auto;">
    <div class="form6_special">
        <a href="javascript:viod(0)"><div class="form6_special_close" onclick="closelogin()"><b>关闭</b></div></a>
    </div>
    <div class="clr"></div>
    <form action="<?php echo front_url('column/column_add');?>" method="post" enctype="multipart/form-data">
        <div class="put" >*专辑标题:<input type="text" id="tit1" name="title" style="float: right;"/>0/30</div>
        <div class="clr1" ></div>
        <div class="put">
            <div class="put1">*分类：</div>
            <?php foreach($column_class as $cck => $ccv):?>
                <input type="radio" name="classid" value="<?php echo $ccv['id'];?>" style="float: none;"/><?php echo $ccv['name'];?>
            <?php endforeach;?>
        </div>
        <div class="clr1"></div>
        <div class="put" style="float: left">
            <div class="depict">专辑描述: </div>
            <textarea id="area" name="desc"></textarea>
            <div class="depict">0/120</div>
        </div>
        <div class="clr1"></div>
        <div class="put">
            <div class="put1">专辑封面：</div>
            <input type="file" name="img" />
        </div>
        <div class="clr1"></div>
        <input type="submit" id="sub" value="确定">
        <div style="color: darkred;"><?php if(!empty($error)) echo $error;?></div>
        <div style="color: darkred;"><?php echo validation_errors(); ?></div>
    </form>
</div>
<script type="text/javascript">
    var bheight=$("body").height();
    function openlogin(){
        $("#bg").css("display","block");
        $("#bg").css("height",bheight);
        document.getElementById("form5").style.display="block";
    }
    function closelogin(){
        document.getElementById("bg").style.display="none";
        document.getElementById("form5").style.display="none";
    }

</script>
<?php $this->load->view('public/member_pubfooter');?>
